package com.xm.servlet.admin;

/**
* @Description: 查看所有用户处理器
* @Author: Mr.Wang
* @Date: 2020/8/17
*/
import com.xm.biz.UsersBiz;
import com.xm.biz.impl.UsersBizImpl;
import com.xm.po.Users;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/userAll")
public class UserAllServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        UsersBiz usersBiz = new UsersBizImpl();
        List<Users> users = usersBiz.userQueryAll();
        request.setAttribute("userList",users);
        request.getRequestDispatcher("admin/user.jsp").forward(request,response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request,response);
    }
}
